package com.example.shop.goods.enums;

public enum EvaluationSortRules {
    THUMB_UP_NUMBER("thumb_up_number","thumbUpNumber"),
    EVALUATION_DATE("evaluation_date","evaluationDate");
    public static final String SORT_SQL =
            " " +
            "<choose>" +
                "<when test='ew.sortRules != null'>" +
                    "${ew.sortRules.getDbField()}" +
                "</when>" +
                "<otherwise>" +
                    "evaluation_date" +
                "</otherwise>" +
            "</choose>" +
            " ";
    private String dbField;
    private String esField;
    EvaluationSortRules(String dbField,String esField){
        this.dbField = dbField;
        this.esField = esField;
    }

    public String getDbField() {
        return dbField;
    }

    public String getEsField() {
        return esField;
    }
}
